package com.wuji1626.spark.rdd.create

import org.apache.spark.{SparkConf, SparkContext}

object RDD_File_Parallelism {
    def main(args: Array[String]): Unit = {
        // Step1: 准备环境
        val sparkConf = new SparkConf().setMaster("local[*]").setAppName("RDDCreate")
        val sc = new SparkContext(sparkConf)

      // Step2: 创建 RDD
      val rdd = sc.textFile("datas/1.txt")
      rdd.collect().foreach(println)
      rdd.saveAsTextFile("output")

      // Step3: 关闭环境
      sc.stop()

    }
}
